home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_07_04
/
v7n4055a.txt
< prev
next >
Wrap
Text File
|
1989-02-28
|
2KB
|
53 lines
/*
* zansi2.c - legal ANSI constructs rejected by Zortech compilers.
*/
#include <stddef.h>
typedef struct foo FOO;
struct foo {
int a, b;
FOO *left, *right;
};
/*
* In ANSI C, each occurrence of a "trigraph" must be replaced
* by a single character. One such trigraph is "??(", which must
* by replaced by "[".
*/
char feeb??(4] = "Are trigraphs supported?";
^
"zansi2.cpp", line 18 Syntax error: '=', ';' or ',' expected
main(int argc, char **argv)
{
long double foo = 1.2L; /* L suffix means long double constant */
^
"zansi2.cpp", line 22 Syntax error: '=', ';' or ',' expected
float fee = 1.2F; /* F suffix means float (default would be double) */
^
"zansi2.cpp", line 23 Syntax error: '=', ';' or ',' expected
/*
* The language specification for C++ is too vague to determine whether or
* not it allows auto aggregate initializers. ANSI C, however, explicitly
* allows them, so C++ will presumably follow suit.
*/
FOO x = { 1, 2 }; /* ANSI C allows auto aggregate initializers */
^
"zansi2.cpp", line 29 Syntax error: can't init auto structs or auto arrays
size_t offset;
wchar_t wide_char_type; /* wchar_t is required in stddef.h */
^
"zansi2.cpp", line 31 Syntax error: undefined identifier 'wchar_t'
offset = offsetof(FEE, b); /* offsetof is required in stddef.h */
^
"zansi2.cpp", line 33 Syntax error: undefined identifier 'FEE'
}